<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/rework/reworklist" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="reworkdata" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />

            <label>StartTime<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="startTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss"
                   size="18" id="start-date-input" readonly value="${startTime.format('yyyy-MM-dd HH:mm:ss')}">&nbsp;
            <label>EndTime<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="endTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss"
                   size="18" id="end-date-input" readonly value="${endTime.format('yyyy-MM-dd HH:mm:ss')}" >&nbsp;
            <button type="submit" class="btn-default" data-icon="search">Query</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/boetv/exportExcel')" data-icon="file-excel-o" title="导出Excel">Excel</button>&nbsp;
        </div>
    </form>
</div>

<g:if test="${reworkdata.size()>0}">
<div class="bjui-pageContent tableContent">
    <table>
        <div id="rework" style="width:100%;height:58%;" ></div>
        <script  src="${request.getContextPath()}/js/echarts/echarts.js"></script>
        <script  src="${request.getContextPath()}/js/echarts/echarts-tool.js"></script>
        <script type="text/javascript">
            // 基于准备好的dom，初始化echarts实例
            var contextPath = "${request.getContextPath()}";
            eChartsTool.init(contextPath);
            var data=[];
            <g:each in="${reworkdata}" status="i" var="tableInstance">
            data.push('${tableInstance.REWORK_CODE}');
            </g:each>

            // 指定图表的配置项和数据
            var option = {
                /*backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色*/
                // 图表标题
                title: {

                },

                tooltip : {
                    trigger: 'rework123'
                },

                legend: {
                    data:['ReworkQty','ReworkRation']

                },
                xAxis: {
                    data:data
                },
                yAxis : [
                    {
                        type : 'value',
                        name:'ReworkQty',
                        axisLabel : {
                            formatter: '{value}'
                        },
                        show:true
                    },
                    {
                        type : 'value',
                        name:'ReworkRation',

                        axisLabel : {
                            formatter: '{value}%'
                        },
                        show:true
                    }
                ],
                series : [
                    {
                        name: 'ReworkQty',
                        type: 'bar',
                        data:${reworkdata.REWORK_QTY}
                    },
                    {
                        name: 'ReworkRation',
                        type: 'line',
                        data:${list},
                        yAxisIndex: 1
                    }]
            };
            // 使用刚指定的配置项和数据显示图表。
            eChartsTool.setOption("roma", document.getElementById('rework'), option);
        </script>
    </table>
    <div>
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
        <thead>
            <g:if test="${tableHeadList.size()>0}">
                <tr>
                    <g:each in="${tableHeadList}" status="j" var="headInstance">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:each>
                </tr>
                </thead>
                <tbody>
                <g:each in="${reworkdata}" status="i" var="dataInstance">
                    <tr>
                        <td>${dataInstance.REWORK_CODE}</td>
                        <td><a data-toggle="navtab" data-id="rework-navtab-form" data-title="ReworkDetailReport"href="${request.getContextPath()}/rework/reworkDetail?startTime=${startTime.format('yyyy-MM-dd HH:mm:ss')}&endTime=${endTime.format('yyyy-MM-dd HH:mm:ss')}&action_code=${dataInstance.REWORK_CODE}">${dataInstance.REWORK_QTY}</a></td>
                        <td>${dataInstance.RATION}</td>
                        %{--<g:each in="${tableHeadList}" status="j" var="headInstance">--}%
                                %{--<g:if test="${headInstance=='REWORK_QTY'}">--}%
                                %{--<td><a data-toggle="navtab" data-id="rework-navtab-form" data-title="ReworkDetailReport"href="${request.getContextPath()}/rework/reworkDetail?startTime=${startTime}&endTime=${endTime}&action_code=${dataInstance["${headInstance.REWORK_CODE}"]}">${dataInstance["${headInstance}"]}</a></td>--}%
                                %{--</g:if>--}%
                            %{--<g:else>--}%
                                %{--<td>${dataInstance["${headInstance}"]}</td>--}%
                            %{--</g:else>--}%
                        %{--</g:each>--}%
                    </tr>
                </g:each>
            </g:if>
            <g:else>
            <g:render template="../template/emptyPanel" />
            </g:else>
        </tbody>
        </table>
    </div>
</div>
</g:if>

